#include<bits/stdc++.h>
using namespace std;
typedef struct Node{
	int data[1000];
	int last;
}NODE,*LinkList;
LinkList create(LinkList L){
	L=(LinkList)malloc(sizeof(NODE));
	int n;
	scanf("%d",&n);
	L->last=0;
	for(int i=1;i<=n;i++){
		scanf("%d",&L->data[i]);
		L->last++;
	}
	return L;
}int BS(LinkList L,int x){
	int low=1,high=L->last;
	while(low<=high){
		int mid=(low+high)/2;
		if(x>L->data[mid])
			low=mid+1;
		else if(x<L->data[mid])
			high=mid-1;
		else
			return mid;
	}
	return 0;
}
int main(){
	LinkList L;
	int x,pos;
	L=create(L);
	scanf("%d",&x);
	pos=BS(L,x);
	printf("%d",pos); 
	return 0;
}
